package com.example.javaEE.repository;

import com.example.javaEE.model.Book;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
    public interface BookRepository extends JpaRepository<Book, Long> {
        List<Book> findByNameContaining(String name);

        List<Book> findByAuthorContaining(String author);

        List<Book> findByPublisherContaining(String publisher);

    List<Book> findByAuthorContainingAndPublisherContaining(String author, String publisher);

    List<Book> findByNameContainingAndAuthorContainingAndPublisherContaining(String name, String author, String publisher);

    List<Book> findByNameContainingAndAuthorContaining(String name, String author);

    List<Book> findByNameContainingAndPublisherContaining(String name, String publisher);
}

